<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.33">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
span.s1 {color: #307109}
span.s2 {color: #606060}
span.s3 {color: #0013bc}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><b>WarpOverlap<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>Create a texture of Warps</b></p>
<p class="p2"><br></p>
<p class="p3">Inspired by Chad Kirby's SuperCollider2 Warp1 class, which was inspired by Richard Karpen's sndwarp for CSound. A granular time strecher and pitchshifter. See the [<b>Warp1]</b> helpfile for more information about Warp1's specifics. This texture will create a series of Warp1s that keep up with the current time.</p>
<p class="p2"><br></p>
<p class="p3"><b>WarpOverlap.ar(numChans = 1, buffer, overlaps = 4, starttime = 0, stretch = 1, harm = 1, windowsize = 6,<span class="Apple-converted-space"> </span></b></p>
<p class="p3"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>step = 1,</b> <b>warpwindowsize = 0.11, warpwindowoverlaps = 8, warpwindowran = 0.1, mul = 1,</b></p>
<p class="p3"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>add = 0)</b></p>
<p class="p2"><br></p>
<p class="p3"><span class="Apple-tab-span">	</span><b>buffer</b> - the buffer number of a mono soundfile.</p>
<p class="p3"><span class="Apple-tab-span">	</span><b>overlaps - </b>the number of overlapping warps to create (should be equal to or greater then 3).</p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>this must be a fixed integer. The architechture of the SynthDef</p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>cannot change after it is compiled.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>starttime - </b>an initial starttime for the warp pointer (in the total buffer)</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>stretch -</b> a stretch factor for the individual Warps.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>harm - </b>a float, or an instance of a Ref. If a Ref is used, its values are sequentially distributed among the<span class="Apple-converted-space"> </span></p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>larger overlapping windows.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>windowsize -</b> the windowsize in seconds of the larger overlapping windows.</p>
<p class="p3"><span class="Apple-tab-span">	</span><b>step -</b> a control on the pointer increment. 1 keeps the pointer up with the current time, 0 will halt time.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>warpwindowsize -</b> a float, or an instance of a Ref. The size of the individual warp windows.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>warpwindowoverlaps -</b> a float, or an instance of a Ref. The number of window overlaps for each warp.<span class="Apple-converted-space"> </span></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>warpwindowran -</b> a float, or an instance of a Ref. The amount of randomness in each warp's windows.</p>
<p class="p2"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p3"><b>Examples:</b></p>
<p class="p2"><br></p>
<p class="p3">s.boot;</p>
<p class="p4"><br></p>
<p class="p5">(</p>
<p class="p5">s.sendMsg(<span class="s1">\b_allocRead</span>, 0, <span class="s2">"sounds/a11wlk01.wav"</span>, 0, -1);</p>
<p class="p4"><br></p>
<p class="p5"><span class="s3">SynthDef</span>(<span class="s1">\warpoverlap</span>, {<span class="s3">arg</span> buffer = 0, stretch = 1, windowsize = 6, mul = 1, gate = 1;</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s3">var</span> out, env, overlaps, harm, wwinsize, wwinoverlap, wwinran;</p>
<p class="p5"><span class="Apple-tab-span">	</span>overlaps = 8;</p>
<p class="p5"><span class="Apple-tab-span">	</span>harm = [3, 7, 5, -12].midiratio.asRef;</p>
<p class="p5"><span class="Apple-tab-span">	</span>wwinsize = `[0.11, 0.11, 0.11, 0.2];</p>
<p class="p5"><span class="Apple-tab-span">	</span>wwinsize = 0.11;</p>
<p class="p5"><span class="Apple-tab-span">	</span>wwinoverlap = 8;</p>
<p class="p5"><span class="Apple-tab-span">	</span>wwinran = 0.1;</p>
<p class="p5"><span class="Apple-tab-span">	</span>env = <span class="s3">EnvGen</span>.kr(<span class="s3">Env</span>([0.01, 1, 0.01], [0.1, 0.1], <span class="s1">'exp'</span>, 1), gate, doneAction: 2);</p>
<p class="p5"><span class="Apple-tab-span">	</span>out = <span class="s3">WarpOverlap</span>.ar(1, buffer, overlaps, 0, stretch, harm, windowsize, wwinsize, wwinoverlap, wwinran, mul);</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s3">Out</span>.ar(0, out * env);</p>
<p class="p5">}).send(s);</p>
<p class="p4"><br></p>
<p class="p5">)</p>
<p class="p4"><br></p>
<p class="p5">s.sendMsg(<span class="s1">\s_new</span>, <span class="s1">\warpoverlap</span>, a=s.nextNodeID, 0, 1, <span class="s1">\buffer</span>, 0, \stretch, 30, \mul, 0.1)</p>
<p class="p4"><br></p>
<p class="p5">s.sendMsg(<span class="s1">\n_free</span>, a);</p>
<p class="p4"><br></p>
<p class="p4"><br></p>
</body>
</html>
